package com.cplh.sharding.demo.controller;


import com.cplh.sharding.demo.request.ConHjQzdHisQuery;
import com.cplh.sharding.demo.response.ResultDto;
import com.cplh.sharding.demo.service.ConHjQzdHisService;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author: kangzhijin
 * @since: 2022/10/12
 * @version: 1.0
 * @description:
 **/
@Slf4j
@RestController
@RequestMapping("/api")
public class ConHjQzdHisController {
    @Resource
    private ConHjQzdHisService conHjQzdHisService;



    @GetMapping("/queryHjQzjHisById/{id}")
    public ResultDto queryHjQzdHis(@PathVariable("id") String id) {
        ConHjQzdHisQuery params = new ConHjQzdHisQuery();
        params.setId(id);

        return ResultDto.success(conHjQzdHisService.queryOrdersMapperNormal(params).getList().get(0));
    }

    @PostMapping("/queryHjQzjHis")
    public ResultDto queryHjQzdHisPost(@RequestBody ConHjQzdHisQuery request) {
        log.info("查询请求参数:{}", request);
        return ResultDto.success(conHjQzdHisService.queryOrdersMapperNormal(request).getList());
    }






}
